package com.spzx.user.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.user.api.domain.UserAddress;
import com.spzx.user.api.service.RemoteUserAddressService;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteUserAddressFallbackFactory implements FallbackFactory<RemoteUserAddressService> {
    @Override
    public RemoteUserAddressService create(Throwable cause) {
        return new RemoteUserAddressService() {
            @Override
            public R<UserAddress> getUserAddressByUserId(Long id, String source) {
                return R.fail("远程调用获取用户地址失败");
            }
        };
    }
}
